package org.insia.smartposse.mapping.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.criterion.Expression;
import org.insia.smartposse.mapping.FreelanceBooks;
import org.insia.smartposse.mapping.Users;
import org.insia.smartposse.mapping.base.BaseFreelanceBooksDAO;


public class FreelanceBooksDAO extends BaseFreelanceBooksDAO implements org.insia.smartposse.mapping.dao.iface.FreelanceBooksDAO {

	public FreelanceBooksDAO () {}

	public FreelanceBooksDAO (Session session) {
		super(session);
	}

	public List<FreelanceBooks> findBooksByFreelance(Users user, Session session) {
		return session.createCriteria(getReferenceClass())
		.add(Expression.eq("Freelance", user))
		.list();
	}
}